package com.xiaoxing.zhinenghuacangku_jining.mvp.ui.adapter;

import android.content.Context;
import android.support.annotation.Nullable;
import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.xiaoxing.zhinenghuacangku_jining.R;
import com.xiaoxing.zhinenghuacangku_jining.mvp.ui.entity.JiNing_MeterOutStorageListInfo;

import java.util.List;

//import me.jessyan.armscomponent.commonres.utils.GlideUtil;


public class JiNing_DianBiaoChuKuAdapter extends BaseQuickAdapter<JiNing_MeterOutStorageListInfo, BaseViewHolder> {

    private Context mContext;
    private IJiNing_DianBiaoChuKuAdapter mIJiNing_dianBiaoChuKuAdapter;

    public JiNing_DianBiaoChuKuAdapter(Context context, @Nullable List<JiNing_MeterOutStorageListInfo> data, IJiNing_DianBiaoChuKuAdapter iJiNing_dianBiaoChuKuAdapter) {
        super(R.layout.zhi_neng_cang_ku_ji_ning_item_dian_biao_chu_ku, data);
        this.mContext = context;
        this.mIJiNing_dianBiaoChuKuAdapter = iJiNing_dianBiaoChuKuAdapter;
    }

    @Override
    protected void convert(BaseViewHolder helper, JiNing_MeterOutStorageListInfo item) {
        //GlideUtil.loadImage(mContext,item.getImg(),helper.getView(R.id.img_head));
        helper.setText(R.id.tv_name, item.getMaterial() + "--mid=" + item.getMid());
        helper.setText(R.id.tv_spname, "仓位： " + item.getSpacename());
        helper.setOnClickListener(R.id.btn_agv_chu_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mIJiNing_dianBiaoChuKuAdapter.chuKuAGV(item);
            }
        });
        helper.setOnClickListener(R.id.btn_li_kuchu_ku, new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                mIJiNing_dianBiaoChuKuAdapter.chuKuLiKu(item);

            }
        });

    }

    public interface IJiNing_DianBiaoChuKuAdapter {
        void chuKuAGV(JiNing_MeterOutStorageListInfo item);

        void chuKuLiKu(JiNing_MeterOutStorageListInfo item);

    }

}
